<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title></title>
    <!--覆盖上列样式  -->
    <link rel="stylesheet" href="res/layui/css/layui.css">
    <link rel="stylesheet" href="res/css/global.css">
    <link rel="stylesheet" href="res/css/style.css"/>
    <link rel="stylesheet" href="res/layui/extend/steps/style.css">
  <body >
 

   <div class="header">
      <div class="main">
         <a href="main.html"><img class="fl logoimg" src="res/images/fly.jpg"></a>
            <a class="title fl" href="#">
          我是学生</a>
         <a class="title fl" href="#"> 
          帮助中心</a>
       
        <div class="nav-user">

            <div class="fl user-header-top">
            <a class="lindang" href="">
            <img src="res/images/tx.png">
            </a>
         <div class="tanshow">
            <div class="triangle"></div>
          <div class="personal-fun ">

              <ul>
                  <li class="fun-list">
                      <a href="javascript:;">粉丝</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">课程标签</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">系统通知</a>
                  </li>
              </ul>
              </div>
             </div>
              </div>
            <div class="fl user-header-top">
            <a class="lindang "  href="">
            <img src="res/images/xx.png">
            </a>
                        <div class="tanshow">
            <div class="triangle"></div>
          <div class="personal-fun ">

              <ul>
                  <li class="fun-list">
                      <a href="javascript:;">私聊</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">群聊</a>
                  </li>
               
              </ul>
              </div>
             </div>
            </div>
         <div class="fl user-header-top">
            <a   class="iconfont   icon-touxiang layui-hide-xs" style="margin-top: 4px; display: inline-block;">
            </a>

            <div class="tanshow">
            <div class="triangle"></div>
          <div class="personal-fun ">

              <ul>
                  <li class="fun-list">
                      <a href="setting.html">系统设置</a>
                  </li>
                  <li class="fun-list">
                      <a href="javascript:;">退出登录</a>
                  </li>
              </ul>
              </div>
             </div>
          </div>
        </div>
      </div>
    </div>





     <div class="risk_wrap" >      
     <!--右侧内容开始-->
        <div class="account_quan" >

            <h3 class="risk_title1"><span class="fl">创建课程</span></h3>
            
    
<div id="step_demo" class="step-body">
  <div style="padding:0 180px">
    <div class="step-header " style="width:100%;overflow: hidden;">
        <ul>
            <li>
                <span class="step-name">创建课程</span>
            </li>
            <li>
                <span class="step-name">课程详情</span>
            </li>
            <li>
                <span class="step-name">课程目录</span>
            </li>
            <li>
                <span class="step-name">教师/班级</span>
            </li>
                    
        </ul>
    </div>
     </div>
    <div class="bubottom"></div>
  <div class="basic_infor">
    <div class="step-content">
       <!--  创建课程 -->
        <div class="step-list">
                 <ul class="basic_two layui-form">
          
                    <li>
                        <span class="fl">课程名称</span>       
                          <div class="layui-inline">
                            <div class="layui-input-block">
                                <input id="lessonName" type="text" class="layui-input title" lay-verify="required" placeholder="请输入课程名称">
                            </div>
                        </div>              
                    </li>
                   
                        <li>
                               <div  class="fl">
                        <span class="fl">所属类目</span>       
                          <div class="layui-inline">
                            <div class="layui-input-block">
                                <input id="courseTypeId" type="text" class="layui-input title" lay-verify="required" placeholder="">
                            </div>
                        </div>     
                            </div>    
                           <span class="fl cursorlanl" >点击选择</span>        
                    </li>
                                      
                     <li>
                        <span class="fl">课程类型</span>      
                       <div class="layui-input-inline" >
                        <select name="P1" lay-filter="province" id="province">
                            <option value=""></option>
                            <option value="直播课程">直播课程</option>
                            <option value="录播课程">录播课程</option>
                        </select>
                       </div>
                 
                    </li>
                     <li>
                        <span1 class="fl">课程封面</span1>
                 
                     
                    </li>
                      <div class="addtuchu">
                       <img id="addFaceImg"  class="fl add-face" src="res/images/sc3.png">
                         <div class="fl xianchuanc" style="margin: 30px 0 0 30px;">
                         <p class=" ">图片要求：</p>
                         <p class=" ">1.尺寸大于800*600分辨率小于96dpi大小小于2M</p>
                           <p class=" ">2.支持JPG格式图片</p>
                          <p class=" ">3.该字段修改需审核，请确认后提交</p>
                          </div>
                      
                     
                    </div>
                      <div class="clear"></div>
                  <li>
                        <span class="fl">课程起止日期</span>
                                              
                      <div class="layui-inline">
  
      <div class="layui-input-inline">
        <input type="text" class="layui-input" id="startTime" placeholder="开始时间">
      </div>
    </div> -
                       <div class="layui-inline">
  
      <div class="layui-input-inline">
        <input type="text" class="layui-input" id="endTime" placeholder="结束时间">
      </div>
    </div>
                   
                   </li>
                    <li>
                        <span class="fl">课程价格</span>                                              
                          <div class=" fl">
                            <input type="radio" name="price"  lay-filter="price" value="0" title="免费" checked="">
                            <input type="radio" name="price"  lay-filter="price" value="1" title="付费">
                          </div>
                          <div class="layui-inline fl fufei">                      
                          <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="amount" placeholder="￥">
                          </div>
                        </div>                  
                    </li>

                    <div class="xianchuanc fufei" style="margin: 0 0 0 100px;">
                    <p class=" ">*通过教师资质认证后，可发布5000元以内的课程</p>
                    <br>
                    <p class="cursorqianlan">课程价格修改说明</p>
                    <p class="">1.每次修改价格生效后，最少需要等待7天后的00:00才可进行等二次修改。</p>
                    <p class="">2.每门课程在每个自然月，可以进行两次价格修改。</p>
                    <p class="">3.若需进行限时促销，可至“推广-添加推广-课程销售-限时优惠”操作。</p>
                    <p class="">4.同时修改课程并提交算一次修改，单独修改并提交各算一次。</p>
                    <p class="">5.未发布的课程可随时修改价格,不受本规则限制。</p>
                    </div>

                            <li class='fufei'>
                        <span class="fl">退款承诺</span>                                              
                          <div class=" fl">
                            <input type="radio" name="tuikuan" lay-filter="tuikuan" value="0" title="免课程随时退" checked="">
                            <input type="radio" name="tuikuan" lay-filter="tuikuan" value="1" title="七天包退">
                          </div>
                                      
                    </li>

                    <div class="xianchuanc fufeim" style="margin: 0 0 0 100px;">
                   
                    <p class="cursorqianlan">退款承诺说明</p>
                    <p class="cursoryellow">1.选择退款承诺后，后续不可更改。</p>
                    <p class=" ">2.课程开始前，用户可直接退款。</p>
                    <p class=" ">3.该退款承诺适用于全部课程。</p>
          
                    </div>

                       <div class="xianchuanc fufeiq" style="margin: 0 0 0 100px;">
                   
                    <p class="cursorqianlan">退款承诺说明</p>
                    <p class="cursoryellow">1.选择退款承诺后，后续不可更改。</p>
                    <p class=" ">2.课程开始前，用户可直接退款。</p>
                    <p class=" ">3.课程开始后， <span class="cursoryellow">7天内可向老师申请退款。</span></p>
                    <p class=" ">4.用户申请退款后，老师可在七天内说服学员取消退款。机构确认或逾期未处理，订单进入退款流程。</p>
                    <p class=" ">5.该退款承诺适用于全部课程。</p>
          
                    </div>


                            <li class='fufei'>
                        <span class="fl">IOS渠道</span>                                              
                          <div class=" fl">
                            <input type="radio" name="ios" lay-filter="ios" value="0" title="课程不上架ios app" checked="">
                            <input type="radio" name="ios" lay-filter="ios" value="1" title="课程上架ios app">
                          </div>
                                      
                    </li>

                    <div class="xianchuanc fufeibus" style="margin: 0 0 0 100px;">
                   
                    <p class="cursorqianlan">课程价格修改说明</p>
                    <p class=" ">由于苹果公司的规定，您在 ios App内的课程售卖必须分成30%给苹果公司。同时腾讯课堂将收取5%作为苹果黑卡用户造成损失的弥补。但这不会影响您在PC，Android 或者任何网页版腾讯课堂上的课程售卖，苹果仅仅对交易产生在ios App的部分分成。</p>
       
          
                    </div>

                          <div class="xianchuanc fufeis" style="margin: 0 0 0 100px;">
                      <p class=" ">我接受在ios App中的课程售卖成分35%（PC、Android、H5不受影响 ）</p>
                    <p class="cursorqianlan">课程价格修改说明</p>
                    <p class=" ">由于苹果公司的规定，您在 ios App内的课程售卖必须分成30%给苹果公司。同时腾讯课堂将收取5%作为苹果黑卡用户造成损失的弥补。但这不会影响您在PC，Android 或者任何网页版腾讯课堂上的课程售卖，苹果仅仅对交易产生在ios App的部分分成。</p>
       
          
                    </div>

                </ul>
                   <div class="layui-btn " id="goBtn1" style="margin: 0 0 0 355px">下一步</div>
        </div>
       <!--  课程详情 -->
        <div class="step-list">
        
        
            <ul class="basic_two layui-form">
            <li>
            <span class="spansl">课程简介</span>      
            </li>
            <li>
            <div class="layui-form-text ">
            <div class="layui-input-blockt">
            <textarea id="about" placeholder="编写精彩的课程简介会更吸引人哦" class="layui-textarea" name="desc"></textarea>
            </div>
            </div>
            </li>
               
              <li  style="margin: 30px 0 0 0">
              </li>

                    <li>
                     <span1 class="fl">上传课程详情</span1>                     
                    </li>
                      <div class="addtuchu" >
                       <img id="lessonDetail" class="fl lessonDetail" src="res/images/sc3.png">
                         <div class="fl xianchuanc" style="margin: 30px 0 0 30px;">
                         <p class=" ">图片要求：</p>
                         <p class=" ">1.尺寸大于800*600分辨率小于96dpi大小小于2M</p>
                           <p class=" ">2.支持JPG格式图片</p>
                          <p class=" ">3.该字段修改需审核，请确认后提交</p>
                          </div>
                      
                     
                    </div>
                     </ul>
                      <div class="clear"></div>
             <div class="layui-btn" id="goBtn2" style="margin: 20px 0 0 435px;">下一步</div>
        </div>
         <!--  课程目录直播 -->
    <!--     <div class="step-list">
            <ul class="basic_two layui-form">
            <div class="chuanjianzhibo">
            <div class="mulv">目录(1)</div>
            <div class="mulvul">
            <div class="fl mulv"> ●  图标绘制 </div>    
            <div class="fr user-header-top" style="cursor:pointer;">    
            <img class="mulv" src="res/images/gd.png">           
           <div class="tanshow">
            <div class="triangle"></div>
             <div class="personal-fun ">
              <ul>
                  <li class="fun-list xiugai">
                      <a href="javascript:;" >修改</a>
                  </li>
                  <li class="fun-list batchDel">
                      <a href="javascript:;">删除</a>
                  </li>
               
              </ul>
              </div>
             </div>
            </div>
            <div class="clear"></div>
               <div class="zhishidianli">
               <p>1.有趣的图标进化史<span>可试学</span></p>
                <time>2018-11-07 09:30-11:30</time>
                </div>
               <div class="zhishidianli">
                <p>2.有趣的图标进化史 </p>
                 <time>2018-11-07 09:30-11:30</time>
                </div>
           </div>



 <div class="mulvul">
                   <div class="fl mulv"> ●  课程目录 </div>
                   <div class="fl">    
                    <div class="layui-inline width260 marginr" >
                            <div class="layui-input-block width260">
                                <input type="text" class="layui-input width260 "  placeholder="请输入课程目录">
                            </div>
                        </div>  
                   </div>
            <div class="clear"></div>
            
            <div class="zhishidianpart">
                <div class="fl mulv marginr1">知识点1 </div>    
                 <div class="fl">    
                  <div class="layui-inline width260 marginr2" >
                          <div class="layui-input-block width260">
                              <input type="text" class="layui-input width260 "  placeholder="请输入知识点标题">
                          </div>
                      </div>  
                </div>
                <img class="fl marginr3 deletemulv" src="res/images/qx.png">
                  <div class="clear"></div>
                <div class="marginr4">
                 <div class="">
                授课时间
               </div>
                <div class="layui-inline width260">
                  <div class="layui-input-inline width260">
                    <input type="text" class="layui-input width260 test1" id="" placeholder="开始时间">
                  </div>
                </div>
                <div class="layui-inline width160">
                <div class="layui-input-inline width160">
                <input type="text" class="layui-input width160 test2" id="" placeholder="请选择授课时间">
                </div>
                </div> -
                <div class="layui-inline width160">
                <div class="layui-input-inline width160">
                <input type="text" class="layui-input width160 test3" id="" placeholder="请选择授课时间">
                </div>
                </div>
                </div>
             </div> 

             <div class="layui-btnqhui" style="margin: 0 0 0 90px">+添加知识点标题</div>

            <li>
            <span class="fl  mulv marginr1">允许试学</span>
            <div class=" fl marginr1">
            <input type="radio" name="yes" value="是" title="是" checked="">
            <input type="radio" name="yes" value="否" title="否">
            </div>
            </li>
            <div class="clear"></div>          
            </div> 

         <div class="comment">

         </div>
      



          <div class="layui-btnqlan addmulv" style="margin: 20px 0 0 80px;">+添加课程目录</div>
          <div class="clear"></div>
  
           
            

          
            </div>
            <div class="clear"></div>
            <div class="layui-btn" id="goBtn3" style="margin: 20px 0 0 435px;">下一步</div>

            </ul >
        </div> -->


  <!--  课程目录录播 -->
        <div class="step-list">
            <ul class="basic_two layui-form">
          
            <div class="chuanjianlubo">
            <div class="taitou">
            <div class="mulv fl marginr5">目录1</div>
            <div class="fl">    
                <div class="layui-inline width345 marginr" >
                    <div class="layui-input-block width345 marginr6">
                        <input type="text" class="layui-input width345" style="background-color:#FFFFFF!important;"  placeholder="请输入课程目录">
                    </div>
                </div>  
             </div>
              <div class="fl cursorlanl marginr10">添加知识点</div>  
              <div class="fr cursorlanl marginr9 deletemulvlubo">删除</div>  
            <div class="clear"></div>
            </div>
           
            <div class="zhishidiantou">
            <div>
            <div class="mulv fl marginr5">知识点</div>
            <div class="fl">    
                <div class="layui-inline width345 marginr" >
                        <div class="layui-input-block width345 marginr7">
                            <input type="text" class="layui-input width345 "  placeholder="请输入课程目录">
                        </div>
                </div>  
             </div>
              <div class="clear"></div>
             </div>

            <div>
            <div class="mulv fl marginr5">知识点视频</div>
            <div class="fl">    
                    <div class="layui-inline width345 marginr" >
                            <div class="layui-input-block width345 marginr8">
                                <input type="text" class="layui-input width345 "  placeholder="请输入课程目录">
                            </div>
                        </div>  
             </div>
               <span id="cursorqianlanm" class="fl cursorqianlanm marginr5"><img src="res/images/qx.png"><img src="res/images/scq.png" style="margin: 0 10px">上传课程材料</span>
                     <div class="fr marginr9 ">删除</div> 
              <div class="clear"></div>
             </div>
             </div>          
            </div>



         <div class="commentlubo">

         </div>
      



          <div class="layui-btnqhui addmulvlb" style="margin: 20px 0 0 425px;">+添加目录</div>
          <div class="clear"></div>


            <div class="clear"></div>
            <div class="layui-btn" id="goBtn3" style="margin: 20px 0 0 435px;">下一步</div>

            </ul >
        </div>

          <!--  教师/班级 -->
        <div class="step-list">
                        <ul class="basic_two layui-form">
                     <li>
                        <span1 class="fl">课程教师</span1>
                 
                     
                    </li>
                   
                      <div class="teacherkuang">
                      <img class="fl teacher-face" src="res/images/869341256.png">
                      <div class="fl wcontent">
                          <p class="teacher-name">甄妮</p>
                          <p class="teacher-intro">目前任职于腾讯，目前任职于腾讯，目前任职于腾讯，目前任职于腾讯目前任职于腾讯目前任职于腾讯目前任职于腾讯目前任职于腾讯目前任职于腾讯，目前任职于腾讯，目前任职于腾讯，
                          </p>
                          <p><span>编辑</span><span>删除</span></p>
                       </div>
                       <div class="clear"></div>
                      </div>

                      <div class="teacherkuang">
                      <br > <br >
                        <div class="jiahao tjls">+</div>
                        <div class="jiahaow tjls">点击添加老师</div>
                    
                      </div>


                <li>
                 
                 
                </li>


                   <li>
                        <div  class="fl">
                          <span class="fl">助教</span>       
                          <div class="layui-inline">
                            <div class="layui-input-block">
                                <input type="text" readonly="readonly" class="layui-input title" lay-verify="required" placeholder="" value="甄妮；哈哈">
                            </div>
                          </div>    
                           </div>         
                            <span class="fl cursorlanl tjls" >添加</span>            
                    </li>
               
                    <li>
                        <div  class="fl">
                        <span class="fl">销售</span>       
                          <div class="layui-inline">
                            <div class="layui-input-block">
                                <input type="text" readonly="readonly" class="layui-input title" lay-verify="required" placeholder="">
                            </div>
                        </div>
                          </div>         
                           <span class="fl cursorlanl tjls" >添加</span>          
                    </li>



                        <li>
                        <span class="fl">创建班群</span>       
                          <div class="layui-inline">
                            <div class="layui-input-block">
                                <input type="text" class="layui-input title" lay-verify="required" placeholder="请输入班级名称">
                            </div>
                        </div>              
                        </li>
                        <div class="xianchuanc">                  
                         <p class="">*请选择适合的群接待学生，用户报名后自动加入班级群</p>                    
                         </div>
              <!--           <li>
                        <div class="fl">
                        <span class="fl">上传材料</span>       
                          <div class="layui-inline">
                            <div class="layui-input-block">
                                <input type="text" class="layui-input title" lay-verify="required" placeholder="">
                            </div>
                        </div>
                       </div>
                        <span class="fl cursorqianlanm"><img src="res/images/scq.png" style="margin: 0 10px">上传课程材料</span>

                    </li>
                  -->
                   <div class="layui-btn width135" id="" ><a href="kechengyulan.html">预览课程</a></div>
                   <div class="layui-btn width135" id="" >完成创建仅保存</div>
                   <div class="layui-btn width135" id="save" >完成创建并发布</div>
                </ul>
        </div>
       
        
    
    </div>
   </div>
</div>

<!-- <button id="preBtn">上一步</button> -->
<!-- <button id="nextBtn">下一步</button> -->
<!-- <button id="goBtn">跳转的指定的步骤</button>
 -->
            
   

                 
        </div>
        <!--右侧内容结束-->
    </div>


   <!--直播课程目录弹窗-->
<div id="xiumulv" class="white_content">

       <div class="con layui-form">
           
            <div class="mulvul">
                   <div class="fl mulv"> ●  课程目录 </div>    
                   <div class="fl">    
                    <div class="layui-inline width260 marginr" >
                            <div class="layui-input-block width260">
                                <input type="text" class="layui-input width260 "  placeholder="请输入课程目录">
                            </div>
                        </div>  
                   </div>
            <div class="clear"></div>
            
            <div class="zhishidianpart">
                <div class="fl mulv marginr1">知识点1 </div>    
                 <div class="fl">    
                  <div class="layui-inline width260 marginr2" >
                          <div class="layui-input-block width260">
                              <input type="text" class="layui-input width260 "  placeholder="请输入知识点标题">
                          </div>
                      </div>  
                </div>
                <img class="fl marginr3" src="res/images/qx.png">
                  <div class="clear"></div>
                <div class="marginr4">
                 <div class="">
                授课时间
               </div>
                <div class="layui-inline width260">
                  <div class="layui-input-inline width260">
                    <input type="text" class="layui-input width260 test1" id="" placeholder="开始时间">
                  </div>
                </div>
                <div class="layui-inline width160">
                <div class="layui-input-inline width160">
                <input type="text" class="layui-input width160 test2" id="" placeholder="请选择授课时间">
                </div>
                </div> -
                <div class="layui-inline width160">
                <div class="layui-input-inline width160">
                <input type="text" class="layui-input width160 test3" id="" placeholder="请选择授课时间">
                </div>
                </div>
                </div>
             </div> 

             <div class="layui-btnqhui" style="margin: 0 0 0 90px">+添加知识点标题</div>

            <li>
            <span class="fl  mulv marginr1">允许试学</span>
            <div class=" fl marginr1">
            <input type="radio" name="shixue" value="是" title="是" checked="">
            <input type="radio" name="shixue" value="否" title="否">
            </div>
            </li>
            <div class="clear"></div>          
            </div>
      </div>

</div>


   <!--添加教师弹窗-->
<div id="tjls" class="white_content">

             <div class="con1">
         <img class="fr closewhite" src="res/images/3d0b1461ef43b3e0374c884e9cadf5f.png">  
         <p class="lookmulucenter ">添加教师</p>

        <div class="font14">选择教师</div>
        
         <ul class='yixuankuang'>
            <li>
               <div ><input type="text" name="" placeholder="请输入关键字或ID筛选"></div>
              <p>甄妮（0231）</p>
               <p>甄妮（0231）</p>   
            </li>
        
         </ul>
         <div class='yixuankuangbtn'>
           <div>添加</div>
           <div>删除</div>
         </div>
             <ul class='yixuankuang'>
            <li>
              <p>甄妮（0231）</p>
               <p>甄妮（0231）</p>   
            </li>
        
         </ul>
         <div class="clear"></div>
           <div class="layui-btn" style="margin: 20px 0 0 120px;">确定</div>
      </div>

</div>



  <div class="black_overlay"></div>


  <!-- 底部结束 -->
    <!--账户总览结束-->

<script src="res/layui/layui.js"></script>
 <script src="res/js/jquery-1.9.1.min.js"></script>
 <script src="res/js/script.js"></script>
  <script src="res/js/global.js"></script>
    <script type="text/javascript" src="res/layui/config.js"></script>
    <script src="js/request.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/teachHead.js" type="text/javascript" charset="utf-8"></script>
<script>
	
var data={
    lessonName:'',  //课程名称
    courseTypeId:'', //课程类型id
    amount:0, //价格单位分
    coverImgUrl:'',//封面图片
    auditState:'', //保存状态（0：保存并发布，3：保存未发布）
    iosRelease:1, //是否ios发行（0：不发行，1：发行）
    about:'', //简介
    userId:'', //上课老师id
    details:'', //课程详情(json存储)
    level:'',//1 零基础 2 进阶
    liveType:'',//课程类型（0：直播，1：点播）
    refundType:'',//退款类型（0：课前退，1：7天退款）
    chapterModels:'',//章节集合
    assistant:'',//助教json
    sales:'',//销售json
    className:'',//班级群名称
    startTime:'',//开始时间
    endTime:'',//结束时间
}

layui.use(['jquery', 'steps','form', 'layedit', 'laydate', 'element',"upload"], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate
  ,element = layui.element
  ,upload = layui.upload;
  
   
    var $ = layui.$;
	getInfo(function(res){
		var userInfo=res.data
		var $teacherkuang=$('.teacherkuang').eq(0)
		$teacherkuang.find('.teacher-name').text(userInfo.nickName);
		$teacherkuang.find('.teacher-intro').text(userInfo.personalIntro);
		$teacherkuang.find('.teacher-face').attr('src',userInfo.pictureAddress);
	})
	
    var $step= $("#step_demo").step();

    $("#preBtn").click(function(event) {
        $step.preStep();//上一步
    });
    $("#nextBtn").click(function(event) {
        $step.nextStep();//下一步
    });
	//第一步
    $("#goBtn1").click(function(event) {
		data.lessonName = $("#lessonName").val();
		if(isEmpty(data.lessonName)) {
			layer.msg('课程名不能为空');
			return;
		}
		data.courseTypeId = $("#courseTypeId").val();
		if(isEmpty(data.courseTypeId)){
			layer.msg('课程类型不能为空');
			return;
		} 
		if(isEmpty(data.liveType)){
			layer.msg('播放类型不能为空');
			return;
		} 
		if(isEmpty(data.startTime)) 
		layer.msg('开始时间不能为空');
		if(isEmpty(data.endTime)) 
		layer.msg('结束时间不能为空');
		data.amount==0?0:$('#amount').val()*100;
       $step.goStep(2);//到指定步
    });
	//第二部
    $("#goBtn2").click(function(event) {
		data.about = $('#about').val();
       $step.goStep(3);//到指定步
    });

    $("#goBtn3").click(function(event) {
       $step.goStep(4);//到指定步
    });
         laydate.render({
    elem: '.test1'
  });

       laydate.render({
    elem: '.test2'
    ,type: 'time'
  });

        laydate.render({
    elem: '.test3'
    ,type: 'time'
  });
//开始时间
   laydate.render({
    elem: '#startTime'
    ,type: 'date'
	,done: function(value, date){ //监听日期被切换
	data.startTime=value;
  }
  }); 
  laydate.render({
    elem: '#endTime'
    ,type: 'date'
	,done: function(value, date){ //监听日期被切换
	data.endTime=value
  }
  });

  
    laydate.render({
    elem: '#test6'
    ,type: 'datetime'
  });
  
    $(function(){
           $step.goStep(1);//到指定步
    })

    $("#save").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('为了保证教学内容的完整性，课程详情提交审核后，课程详情每月只能修改1次。提交审核后，可通过“课程管理”调整课程简介和课程详情图，请您确认无误后再提交。', {title: '', btn : ['确定', '取消' ]}, function (index) {
                var index = layer.msg('取消中，请稍候', {icon: 16, time: false, shade: 0.8});
                for (var i = 0; i < $checked.length; i++) {
                    var id = $checked[i].value;
                    deleteUser(0, id);
                }

                form.render();
                layer.close(index);
                layer.msg("取消成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })
	
 upload.render({
    elem: '#addFaceImg' //绑定元素
    ,url: baseUrl+'api/upload/file' //上传接口
    ,done: function(res){
      //上传完毕回调
	  if(res.code==0){
		  data.coverImgUrl=res.data;
		  $('.add-face').attr('src',res.data);
	  }
    }
    ,error: function(){
      //请求异常回调
    }
  });	
  upload.render({
    elem: '#lessonDetail' //绑定元素
    ,url: baseUrl+'api/upload/file' //上传接口
    ,done: function(res){
      //上传完毕回调
	  if(res.code==0){
		  data.details=res.data;
		  $('.lessonDetail').attr('src',res.data);
	  }
    }
    ,error: function(){
      //请求异常回调
    }
  });	
  upload.render({
    elem: '#cursorqianlanm' //绑定元素
    ,url: baseUrl+'api/upload/file', //上传接口
	accept:'video'
    ,done: function(res){
      //上传完毕回调
	   console.log(res)
	  if(res.code==0){
		 
		  // $('.lessonDetail').attr('src',res.data);
	  }
    }
    ,error: function(err){
      //请求异常回调
	  console.log(err)
    }
  });	
form.on('select(province)',function(res){
	console.log(res)
	if(res.value=="直播课程"){
		data.liveType=0;
	}else if(res.value=="录播课程"){
		data.liveType=1;
	}
})
form.on('radio(price)', function(res){
if (res.value==0) {
$('.fufei').hide()
$('.fufeiq').hide()
$('.fufeim').hide()
$('.fufeis').hide()
$('.fufeibus').hide()
 $('input:radio[name=tuikuan]')[0].checked = true;
$('input:radio[name=ios]')[0].checked = true;
data.amount=0;//价格
}else if (data.value==1) {
$('.fufei').show()
$('.fufeiq').hide()
$('.fufeim').show()
$('.fufeis').hide()
$('.fufeibus').show()
$('input:radio[name=tuikuan]')[0].checked = true;
$('input:radio[name=ios]')[0].checked = true;
}
form.render()
});  

form.on('radio(tuikuan)', function(data){
	console.log(data)
if (data.value==0) {
$('.fufeiq').hide()
$('.fufeim').show()
}else if (data.value==1) {
$('.fufeiq').show()
$('.fufeim').hide()
}
});  


form.on('radio(ios)', function(data){
if (data.value==0) {
$('.fufeis').hide()
$('.fufeibus').show()
}else if (data.value==1) {
$('.fufeis').show()
$('.fufeibus').hide()
}
});  


$('.xiugai').on('click',function (e) {
    e.stopPropagation();
    $(".black_overlay").show();
      $("#xiumulv").show();   
})

// 直播
var i=0
$('.addmulv').on('click',function (e) {
  i++;
var list="";
list+='<div class="mulvul ">';
list+='<div class="fl mulv"> ●  课程目录 </div>';    
list+=' <div class="fl">';    
list+='<div class="layui-inline width260 marginr" >';
list+=' <div class="layui-input-block width260">';
list+='<input type="text" class="layui-input width260 "  placeholder="请输入课程目录">';
list+='</div>';
list+='</div>  ';
list+=' </div>';
list+='<div class="clear"></div>';

list+='<div class="zhishidianpart">';
list+='<div class="fl mulv marginr1">知识点1 </div>';    
list+='<div class="fl">';    
list+='<div class="layui-inline width260 marginr2" >';
list+='<div class="layui-input-block width260">';
list+='<input type="text" class="layui-input width260 "  placeholder="请输入知识点标题">';
list+='</div>';
list+=' </div>';  
list+=' </div>';
list+='<img class="fl marginr3 deletemulv" src="res/images/qx.png">';
list+='<div class="clear"></div>';
list+='<div class="marginr4">';
list+='<div class="">授课时间</div>';
list+='<div class="layui-inline width260">';
list+='<div class="layui-input-inline width260">';
list+=' <input type="text" class="layui-input width260 test1" id="" placeholder="开始时间">';
list+='</div>';
list+='</div>';
list+='<div class="layui-inline width160">';
list+='<div class="layui-input-inline width160">';
list+='<input type="text" class="layui-input width160 test2" id="" placeholder="请选择授课时间">';
list+='</div>';
list+='</div> - <div class="layui-inline width160">';
list+='<div class="layui-input-inline width160">';
list+='<input type="text" class="layui-input width160 test3" id="" placeholder="请选择授课时间">';
list+='</div>';
list+='</div>';
list+='</div>';
list+='</div> ';

list+='<div class="layui-btnqhui" style="margin: 0 0 0 90px">+添加知识点标题</div>';

list+='<li>';
list+='<span class="fl  mulv marginr1">允许试学</span>';
list+='<div class=" fl marginr1">';
list+='<input type="radio" name="shixue'+i+'" value="是" title="是" checked="">';
list+='<input type="radio" name="shixue'+i+'" value="否" title="否">';
list+='</div>';
list+='</li>';
list+='<div class="clear"></div>';          
list+='</div>';
$('.comment').append(list);
         laydate.render({
    elem: '.test1'
  });

       laydate.render({
    elem: '.test2'
    ,type: 'time'
  });

        laydate.render({
    elem: '.test3'
    ,type: 'time'
  });
form.render()
 })

   $("body").on("click", ".deletemulv", function () {
    i--;
        $(this).parent().parent().remove()
    })

       $(".batchDel").click(function () {
        // var $checkbox = $('.news_list tbody input[type="checkbox"][name="checked"]');
        // var $checked = $('.news_list tbody input[type="checkbox"][name="checked"]:checked');
        // if ($checkbox.is(":checked")) {
            layer.confirm('删除后将清空这个目录的包含的所有内容', {icon: 3, title: '确认删除此目录？', btn : ['删除', '取消' ]}, function (index) {
                // var index = layer.msg('取消中，请稍候', {icon: 16, time: false, shade: 0.8});
                // for (var i = 0; i < $checked.length; i++) {
                //     var id = $checked[i].value;
                //     deleteUser(0, id);
                // }

                form.render();
                layer.close(index);
                layer.msg("删除成功");
                
            })
        // } else {
        //     layer.msg("请选择需要删除的内容");
        // }
    })




// 录播
       
var j=0;
$('.addmulvlb').on('click',function (e) {
  j++;
var list="";
list+='<div class="chuanjianlubo">';
list+='<div class="taitou">';
list+='<div class="mulv fl marginr5">目录'+j+'</div>';
list+='<div class="fl"> ';   
list+='<div class="layui-inline width345 marginr" >';
list+='<div class="layui-input-block width345 marginr6">';
list+='<input type="text" class="layui-input width345" style="background-color:#FFFFFF!important;"  placeholder="请输入课程目录">';
list+='</div>';
list+='</div>';  
list+='</div>';
list+='<div class="fl cursorlanl marginr10">添加知识点</div>';  
list+='<div class="fr cursorlanl marginr9 deletemulvlubo">删除</div> '; 
list+='<div class="clear"></div>';
list+='</div>';

list+='<div class="zhishidiantou">';
list+='<div>';
list+='<div class="mulv fl marginr5">知识点</div>';
list+='<div class="fl">';    
list+='<div class="layui-inline width345 marginr" >';
list+='<div class="layui-input-block width345 marginr7">';
list+='<input type="text" class="layui-input width345 "  placeholder="请输入课程目录">';
list+='</div>';
list+=' </div>';  
list+='</div>';
list+='<div class="clear"></div>';
list+='</div>';

list+='<div>';
list+='<div class="mulv fl marginr5">知识点视频</div>';
list+='<div class="fl"> ';   
list+=' <div class="layui-inline width345 marginr" >';
list+='<div class="layui-input-block width345 marginr8">';
list+='<input type="text" class="layui-input width345 "  placeholder="请输入课程目录">';
list+='</div>';
list+='</div>';  
list+='</div>';
list+='<span class="fl cursorqianlanm marginr5"><img src="res/images/qx.png"><img src="res/images/scq.png" style="margin: 0 10px">上传课程材料</span>';
list+='<div class="fr marginr9">删除</div> ';
list+='<div class="clear"></div>';
list+='</div>';
list+='</div> ';         
list+='</div>';

$('.commentlubo').append(list);
      
form.render()
 })


 $("body").on("click", ".deletemulvlubo", function () {
      j--;
        $(this).parent().parent().remove()
    })
 $("body").on("click", ".yixuankuang li p", function () {
      $('.yixuankuang li p').removeClass('yixuankuangadcl')
        $(this).addClass('yixuankuangadcl')

    })


});

  




</script>
</body>
</html>